<template>
  <div class="box2">
    <p
      v-for="(item, index) in list"
      :key="index"
      @click="dianji(index)"
      :class="{ active: dian == index }"
    >
      {{ item.text }}
    </p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dian: 0,
      list: [
        { text: "首页" },
        { text: "爆爆团" },
        { text: "订单" },
        { text: "我的" },
      ],
    };
  },
  methods: {
    dianji(index) {
      this.dian = index;
    },
  },
};
</script>

<style>
.box2 {
  height: 50px;
  background: white;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 15px 0;
  width: 100%;
  box-sizing: border-box;
  position: fixed;
  bottom: 0;
  border-top: 1px solid #ccc;
}
.box2 .active {
  color: blue;
  font-weight: bold;
}
</style>